//
//  ZJShouCangCell.m
//  英伦府邸
//
//  Created by IOS_DEVELOPER on 2017/8/11.
//  Copyright © 2017年 英伦府邸. All rights reserved.
//

#import "ZJShouCangCell.h"

@implementation ZJShouCangCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.rightTitle.verticalText = @"抢房";
}

-(void)setModel:(ZJRoomModel *)model{
    _model = model;
    
    self.topTitle.text = [NSString stringWithFormat:@"%@%@ %@%@ %@(室)",_model.building_name?:@"",_model.building_unit?:@"",_model.unit_name?:@"",_model.unit_unit?:@"",_model.house_name];
//    self.bottomTitle.text = [NSString stringWithFormat:@"%@ | 建面:%@㎡ | 套内:%@㎡",_model.layout,_model.house_area,_model.actual_area];
    if ([self.model.actual_area integerValue] == 0) {
        self.bottomTitle.text = [NSString stringWithFormat:@"%@ | 建面:%@㎡",_model.layout,_model.house_area];
    }else{
        self.bottomTitle.text = [NSString stringWithFormat:@"%@ | 建面:%@㎡ | 套内:%@㎡",_model.layout,_model.house_area,_model.actual_area];
    }
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    for (UIView *subView in self.subviews) {
        if ([subView isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")]) {
            subView.backgroundColor = [UIColor clearColor]; //设置侧滑 的 背景颜色
            for (UIButton *btn in subView.subviews) {
                if ([btn isKindOfClass:[UIButton class]]) {
                    btn.backgroundColor = [UIColor clearColor]; // 设置侧滑 按钮的背景颜色
                    [btn setImage:[UIImage imageNamed:@"hs_gb"] forState:0];
                    btn.frame = CGRectMake((subView.width - 20)/2,(subView.height - 20) / 2, 20, 20);
                }
            }
        }
        
    }
}
@end
